package cn.org.donald.framework.pojo.vo;


import cn.org.donald.framework.pojo.BaseResult;
import io.swagger.annotations.ApiModel;

/**
 * @author ： Donald
 * @date ： 2020/10/16 21:56
 * @description： 返回数据格式
 */
@ApiModel(value = "HttpResult对象",description = "restful风格响应返回体")
public class HttpResult implements BaseResult {

    private Integer code;

    private String info;

    private Long timestamp;

    private Object data;

    public HttpResult() {
    }

    public HttpResult(Integer code, String info, Object data) {
        this.code = code;
        this.info = info;
        this.timestamp = System.currentTimeMillis();
        this.data = data;
    }

    public HttpResult(Integer code, String info) {
        this.code = code;
        this.info = info;
        this.timestamp = System.currentTimeMillis();
    }

    public HttpResult(Object data) {
        this.code = 200;
        this.info = "请求成功";
        this.timestamp = System.currentTimeMillis();
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
